import { createWebHistory, createRouter, createWebHashHistory } from 'vue-router'
import { constantRoutes } from './routes.js'

const router = createRouter({
  history: createWebHashHistory(),
  routes: constantRoutes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { top: 0 }
    }
  }
})

export default router
